package model

import (
	"inventory/api/bmember"
	"strconv"
)

type MemberMap map[string]*bmember.MemberMobileNickname

func (m MemberMap) Init(memberObjs []*bmember.MemberMobileNickname) {
	for _, member := range memberObjs {
		m[strconv.Itoa(int(member.MemberId))] = member
	}
}

func (m MemberMap) GetKeys() (keys []string) {
	keys = make([]string, 0, len(m))
	for memberID := range m {
		keys = append(keys, memberID)
	}
	return
}
